<?php
include("conn/conn.php");
 include("header.php");
?>

		<!-- 详细内容区 -->
		<div id="content">
			<!-- 在线客服 -->
			
<!-- 在线客服 -->
<div style="position: fixed; left: 1213px; top: 100px;" id="chatContent">
	<div id="chatOnline">
		<div looyu_bound="1" style="cursor: pointer;" id="chatOn_support"></div>
		<div id="chatOn_close"></div>
	</div>
	<div id="chatOffline">
		<div id="chatOfflineBtn">
			<div id="chatOff_support"></div>
			<div id="chatOff_close"></div>
		</div>
		<div id="chatOfflineTip"></div>
	</div>
</div>
			<div class="login_content">
				<div class="login_content_top"></div>
				<div class="order_content_main">
					<div class="confirmation_order">

						<!-- 导航条 -->
						<div class="confirmation_order_title">
							<img src="kfc_files/step_2.gif" usemap="#Map" border="0">
							<map name="Map" id="Map">
								<area shape="rect" coords="6,2,322,29" class="step1" href="###">
							</map>
						</div>

						<!-- 订单明细和优惠 -->
						<div id="order_promotion"><div id="order_promotion">
	<!-- 订单详细  -->
	<div class="order_detail_1">
	<table class="order_detail_table" border="1" width="100%">
		<tbody>
		<tr>
			<th width="6%">序号</th>
			<th width="20%">品名</th>
			<th width="9%">单价</th>
			<th width="10%">数量</th>
			<th width="9%">小计</th>
			<th width="10%">详细</th>
		</tr>

	<?php
	$total=0;
	$array=explode("@",$_SESSION[producelist]);
	$arrayquatity=explode("@",$_SESSION[quatity]);
	$index=0;
	for($i=0;$i<count($array)-1;$i++){
		
		$id=$array[$i];
		$num=$arrayquatity[$i];

		if($id!=""){
			$index++;
			$sql=mysql_query("select * from tb_shangpin where id='".$id."'",$conn);
			$info=mysql_fetch_array($sql);
			$total1=number_format($num*$info[shichangjia],1);
			$total+=$total1;
			$_SESSION["total"]=number_format($total,1);
			?>

		<tr class="food_row" >
					<td><?php echo $index; ?></td>
				<td><?php echo $info[mingcheng]; ?></td>
				<td ><?php echo $info[shichangjia]; ?>元</td>
				<td>
					<?php echo $num; ?>
				</td>
				<td><?php echo $total1; ?>元</td>
				<td><span class="open_btn" onClick="detail_toggle(<?php echo $info['id']; ?>);">[详情]</span></td>
		</tr>
		<tr id="product_detail_<?php echo $info['id']; ?>" style="display:none;">
				<td colspan="6">
					<div class="product_detail">
						<?php echo $info[jianjie]; ?>
					</div>
				</td>
		</tr>

	<?php
		}
	}
	?>

	</tbody>
</table>
</div>

<div class="coupon_code" style="margin-bottom: 37px;*margin-bottom: 40px;">

	<span class="total_price_span" style="margin-left: -46px"><em class="ft_b">总金额：</em><?php echo $_SESSION["total"]; ?>元</span>

</div><!-- 优惠区 -->

</div>
</div>

						<div class="clear"></div>
					
					</div>
					<p class="al_c mt35px">
						<input id="step_back" class="step1 backbtn" type="button">
						<input id="step_pay" class="nextbtn" type="button">
					</p>
				</div>
				<div class="login_content_btm"></div>
			</div>
		</div>
	
	<!-- footer -->
<script type="text/javascript">

function detail_toggle(id){
	$('#product_detail_'+id).toggle();
}


$(function(){

	$('#step_back').click(function(){
		window.location="shopping.php";
	});
	$('#step_pay').click(function(){
		window.location="pay.php";
	});
});

</script>
<?php include("footer.php");?>